// MsgParserError.h	class MsgParserError

#ifndef _KC_MESSAGE_PARSER_ERROR__H_2008_KC_
#define _KC_MESSAGE_PARSER_ERROR__H_2008_KC_

#include <iostream>
#include <string>
#include "Position.h"
 
namespace kc_sf
{

class MsgParserError
{
    public:

        // pomocnicze stale
        typedef enum { UNKNOWN, 
                       DATE_SYNTAX_ERROR, 
                       ADDRESS_SYNTAX_ERROR 
                     } MsgErrorTypes;
        
        MsgParserError( MsgErrorTypes type, 
                        const std::string &error_msg,
                        const std::string &error_line = "" )
        : me_type( type )   {
            me_err = error_msg;
            me_line = error_line;
        }

        MsgParserError( const std::string &error_msg,
                        const std::string &error_line = "" )
        : me_type( UNKNOWN )    {
            me_err = error_msg;
            me_line = error_line;
        }
    
        // typ_bledu - bledna_linia - blad
        friend std::ostream & 
        operator<<( std::ostream &out, const MsgParserError &msg_err ) {
            out << "Found " << msg_err.me_type << " error in line: \n\t" 
                << msg_err.me_line << "\n\t" << msg_err.me_err;
            return out;
        }
    
    private:

        MsgErrorTypes   me_type;        // kategoria bledu
        std::string     me_err;         // opis bledu
        std::string     me_line;        // linia zawierająca błąd
};

}

#endif // _KC_MESSAGE_PARSER_ERROR__H_2008_KC_
